Skip to content

Conversation

@usama54321
Copy link
Contributor

Add new clang build setting EMIT_COMPILER_SOURCE_METADATA that passes
-fdiagnostic-add-output=sarif:file=. The flag emits a SARIF log during the compilation which contains diagnostic information. The path is currently fixed to <object_file_path>.source-metadata.json

passes
-fdiagnostic-add-output=sarif:file=<path>. The flag emits a SARIF log
during the compilation which contains diagnostic information. The path is currently fixed
to <object_file_path>.source-metadata.json
let dataCache = cbc.producer.getSpecDataCache(self, cacheType: DataCache.self)
let constantFlags = dataCache.getStandardFlags(self, producer: cbc.producer, scope: cbc.scope, optionContext: clangInfo, delegate: delegate, inputFileType: resolvedInputFileType)
let cbcWithOutput = cbc.outputs.isEmpty ? cbc.appendingOutputs([outputNode.path]) : cbc
let constantFlags = dataCache.getStandardFlags(self, cbc: cbcWithOutput, optionContext: clangInfo, delegate: delegate, inputFileType: resolvedInputFileType)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These flags are cached and reused across translation units, so I think this is going to incorrectly inject per-TU flags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants